package com.heima.controller;

import com.heima.pojo.PageBean;
import com.heima.pojo.VendingMachine;
import com.heima.pojo.dto.PartnerQueryParamDto;
import com.heima.pojo.dto.VmQueryParamDto;
import com.heima.service.VmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/vm-service/vm")
@Api(value = "设备管理")
@Slf4j
public class VmController {
    @Autowired
    private VmService vmService;
    @GetMapping("/search")
    @ApiOperation("设备分页查询")
    public PageBean selectVmList(VmQueryParamDto vmDto){
        log.info("进来的innerCode是：{}",vmDto.getInnerCode());
        return vmService.selectVmList(vmDto);
    }

    @PostMapping
    public Boolean addVM(@RequestBody VendingMachine vendingMachine){
        return vmService.addVM(vendingMachine);
    }

}
